//护盾数据
class ShieldDataModel {
    private isOpen = 0;         //护盾是否激活
    private inviteList = [];    //已经邀请的玩家列表
    private endTime = 0;        //护盾结束时间
    private shieldStatus = 0;   //护盾(狗)状态

    SetIsOpen(isOpen) {
        this.isOpen = isOpen;
    }

    GetIsOpen() {
        return this.isOpen;
    }

    SetInviteList(inviteList:any) {
        this.inviteList = inviteList;
    }

    GetInviteList() {
        return this.inviteList;
    }

    SetEndTime(endTime:number) {
        this.endTime = endTime;
    }

    GetEndTime() {
        return this.endTime;
    }

    CheckStutus() {
        let oldStatus = this.shieldStatus;
        if (ShieldModel.GetIsOpen() == 0) {
            this.shieldStatus =  Cfg.ShieldStatus.Close;
        } else {
            if (ShieldModel.GetEndTime() <= Game.serverTime) {
                this.shieldStatus =  Cfg.ShieldStatus.Sleep;
            } else {
                this.shieldStatus =  Cfg.ShieldStatus.Walk;
            }
        }
        if (oldStatus != this.shieldStatus) {
            return true;
        }
        return false;
    }

    GetStatus() {
        return this.shieldStatus;
    }
}
let ShieldModel = new ShieldDataModel();